//
//  XHEditCollectionViewCell.m
//  Big Show
//
//  Created by 赵晓航 on 15-5-15.
//  Copyright (c) 2015年 Big_Q. All rights reserved.
//

#import "XHEditCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@interface XHEditCollectionViewCell ()

@property(nonatomic, retain) UIImageView *pic;
@property(nonatomic, retain) UILabel *name;
@property(nonatomic, retain) UIWebView *web;

@end


@implementation XHEditCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.name = [[UILabel alloc] init];
        _name.backgroundColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_name];
        [_name release];
        
        self.web = [[UIWebView alloc] init];
        _web.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_web];
        [_web release];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _web.frame = CGRectMake(0, 80, self.contentView.frame.size.width, self.contentView.frame.size.height);
    _name.frame = CGRectMake(0, 20, _web.frame.size.width, 60);
}

- (void)setDic:(NSDictionary *)dic
{
    if (_dic != dic) {
        [_dic release];
        _dic = [dic retain];
    }
    _name.text = [_dic objectForKey:@"title"];
//    [_web loadHTMLString:[_dic objectForKey:@"content"] baseURL:nil];
    
}


@end
